<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/custom/custom/Base_BomDetail.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/custom/custom/Base_BomDetail.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Detail_Id',
                footer: "Foots",
                cnName: '产品BOM明细',
                name: 'custom/Base_BomDetail',
                url: "/Base_BomDetail/",
                sortName: "Detail_Id"
            });
            const editFormFields = ref({"cProduct_Id":"","QuantityPer":"","SType":"","Remark":""});
            const editFormOptions = ref([[{"dataKey":"productList","data":[],"title":"子项产品","required":true,"field":"cProduct_Id","type":"select"}],
                              [{"title":"比例","required":true,"field":"QuantityPer","type":"text"}],
                              [{"dataKey":"SType","data":[],"title":"管理类型","field":"SType","type":"select"}],
                              [{"title":"备注","field":"Remark"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'Bom_Id',title:'Bom_Id',type:'int',width:80,hidden:true,align:'left'},
                       {field:'cProduct_Id',title:'子项产品',type:'int',bind:{ key:'productList',data:[]},width:180,require:true,align:'left',sort:true},
                       {field:'cProductCode',title:'子项产品编码',type:'string',width:220,align:'left'},
                       {field:'cProductName',title:'子项产品名称',type:'string',width:130,align:'left'},
                       {field:'cProductStandard',title:'子项产品规格',type:'string',width:130,align:'left'},
                       {field:'cUnit_Id',title:'子项产品单位',type:'string',bind:{ key:'unitList',data:[]},width:80,align:'left'},
                       {field:'QuantityPer',title:'比例',type:'int',width:80,require:true,align:'left'},
                       {field:'SType',title:'管理类型',type:'int',bind:{ key:'SType',data:[]},width:140,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'CreateID',title:'创建人id',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:130,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:130,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人Id',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Detail_Id',title:'BOM明细主键ID',type:'int',width:80,hidden:true,readonly:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
